load("//bazel:mongo_src_rules.bzl", "idl_generator", "mongo_cc_library")

package(default_visibility = ["//visibility:public"])

exports_files(
    glob([
        "*.h",
        "*.cpp",
    ]),
)

idl_generator(
    name = "cryptd_options_gen",
    src = "cryptd_options.idl",
    deps = [
        "//src/mongo/db:basic_types_gen",
    ],
)

mongo_cc_library(
    name = "mongocryptd_core",
    srcs = [
        "cryptd_main.cpp",
        "cryptd_options.cpp",
        "cryptd_options_gen",
        "cryptd_options_init.cpp",
        "cryptd_service_entry_point.cpp",
        "cryptd_watchdog.cpp",
    ],
    deps = [
        "//src/mongo/db:commands",
        "//src/mongo/db:dbmessage",
        "//src/mongo/db:server_options_servers",
        "//src/mongo/db:serverinit",
        "//src/mongo/db:validate_api_parameters",
        "//src/mongo/db/query/query_stats",
        "//src/mongo/db/repl:repl_coordinator_interface",
        "//src/mongo/db/shard_role:service_context_non_d",
        "//src/mongo/db/storage:storage_engine_lock_file",
        "//src/mongo/executor:network_interface_factory",
        "//src/mongo/rpc",
        "//src/mongo/s:grid",
        "//src/mongo/transport:message_compressor",
        "//src/mongo/transport:service_executor",
        "//src/mongo/transport:session_manager",
        "//src/mongo/transport:transport_layer",
        "//src/mongo/transport:transport_layer_manager",
        "//src/mongo/util:ntservice",
        "//src/mongo/util:signal_handlers",
        "//src/mongo/util:testing_options",
        "//src/mongo/util:version_impl",
        "//src/mongo/util/concurrency:spin_lock",
        "//src/mongo/util/net:network",
        "//src/mongo/util/options_parser:options_parser_init",
        "//src/mongo/watchdog",
    ] + select({
        "@platforms//os:windows": ["//src/mongo/db:windows_options"],
        "//conditions:default": [],
    }),
)
